package com.example.fragment;

import android.content.Intent;
import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //静态添加
        findViewById(R.id.static_add).setOnClickListener(v->{
            Intent intent = new Intent(MainActivity.this, StaticAddFragmentActivity.class);
            startActivity(intent);
        });
        //动态添加
        findViewById(R.id.dynamic_add).setOnClickListener(v->{
            Intent intent = new Intent(MainActivity.this, DynamicAddFragmentActivity.class);
            startActivity(intent);

        });
        // 底部导航：Fragment+BottomNavigationView
        findViewById(R.id.tab_bottom_1).setOnClickListener(v->{
            Intent intent = new Intent(MainActivity.this, BottomNavigationActivity1.class);
            startActivity(intent);
        });
        //底部导航：Fragment+ViewPager+BottomNavigationView
        findViewById(R.id.tab_bottom_2).setOnClickListener(v->{
            Intent intent = new Intent(MainActivity.this, BottomNavigationActivity2.class);
            startActivity(intent);
        });



    }
}